/**
 * 【案例】字符串大小写转换
 * @param opt
 */
function deal(opt) {
    var str = document.getElementById("old").value;
    switch (opt) {
        case "up":
            str = str.toUpperCase();
            break;
        case "low":
            str = str.toLowerCase();
            break;
    }
    document.getElementById("new").value = str;
}